import request from '@/utils/request'

// 查询系统消息数量
export function messageCount() {
  return request({
    url: `${process.env.VUE_APP_MODULE_ADMIN_API}/api/message/count`,
    method: 'post'
  })
}

export function messageTable(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_ADMIN_API}/api/message/table`,
    method: 'post',
    data: query
  })
}

export function messageLoad(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_ADMIN_API}/api/message/load`,
    method: 'get',
    params: query
  })
}

export function messageRead(messageId) {
  return request({
    url: `${process.env.VUE_APP_MODULE_ADMIN_API}/api/message/read/${messageId}`,
    method: 'post'
  })
}

export function messageSave(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_ADMIN_API}/api/message/save`,
    method: 'post',
    data: query
  })
}

export function messageDelete(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_ADMIN_API}/api/message/delete`,
    method: 'post',
    data: query
  })
}
